program OD;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
    a, b, c, i: Integer;

begin
  writeln('write your numbers please');
  Writeln;
  write('a= ');
  Readln(a);
  write('b= ');
  Readln(b);
  write('c= ');
  Readln(c);
  Writeln('The number(s) which you want are:');
  Writeln;
  if(a=b) and(a=c) and(b=c) then
   begin


   for i:= 1 to a do
    if(a mod i = 0) then
     begin

       write(i);
       write(' ');
      end;
    end else begin


 if(a<=b) and(a<=c) then
  for i:= 1 to a do
   if(a mod i = 0) and ( b mod i = 0) and (c mod i = 0)  then
      begin

       write(i);
       write(' ');
      end;

 if(c<=b) and(c<=a)   then
  for i:= 1 to c do
   if(c mod i = 0) and  (b mod i = 0) and (a mod i = 0)  then
    begin
       write(i);
       write(' ');
      end;
 if(a>=b) and(c>=b)   then
   for i:= 1 to b do
    if(b mod i = 0) and (a mod i = 0) and (c mod i = 0) then
     begin
       write(i);
       write(' ');
      end;
   end;


     Readln;
end.
